package org.ww.common.exception;

/**
 * @program: gmall
 * @description: gmall异常枚举
 * @author: ww
 * @create: 2024-01-12 15:57
 **/

public enum GmallExceptionEnum {

    UNKNOW_EXCEPTION(10000,"系统未知异常"),
    VALIDATION_EXCEPTION(10001,"系统字段校验异常"),
    CODE_SEND_EXCEPTION(10002,"60s内验证码不能重复发送"),
    PRODUCT_UP_EXCEPTION(11000,"商品上架异常"),
    USER_EXIST_EXCEPTION(15001,"用户已存在"),
    PHONE_EXIST_EXCEPTION(15002,"手机号已存在"),
    USERNAME_PASSWORD_VALIDATED_EXCEPTION(15003,"用户名密码错误"),
    STOCK_LOCK_EXCEPTION(21000,"商品库存锁定失败"),
    TOO_MANY_REQUEST(30000,"请求流量过大，请稍后重试");


    private Integer code;
    private String msg;

    GmallExceptionEnum(int code,String msg){
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
